package net.coolskill.demo.springboot.controller;

import com.google.common.collect.ImmutableMap;
import net.coolskill.demo.springboot.service.UserService;
import net.coolskill.demo.springboot.util.Context;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OpenApiController {
    @Autowired
    private UserService userService;

    @RequestMapping("/api/test")
    public Object test1() throws Exception{
        return ImmutableMap.of("a", 22, "b",
            false, "c", 'a',
            "requestId", Context.getRequestId(),
            "user",
            userService.getUserInfo());
    }
}